package com.physique.tea.Controller;

import com.physique.tea.Global.Result;
import com.physique.tea.Mapper.UserMapper;
import com.physique.tea.Pojo.User;
import com.physique.tea.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    @PostMapping("/login")
    public @ResponseBody Result login(@RequestBody User user){
        System.out.println(user.toString());
        return userService.login(user);
    }
    @PostMapping("/register")
    public @ResponseBody Result register(@RequestBody User user){
        return userService.register(user);
    }

}
